<?php
    function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    $Loi = false;
	
    $TenLoaiSanPhamCap3 = $_POST['TenLoaiSanPhamCap3'];
    $MaLoaiSanPhamCap2 = $_POST['MaLoaiSanPhamCap2'];
		    
    $loaisanphamcap3 = new loaisanphamc3bs();
    $loaisanphamcap3->TenLoaiSanPhamCap3 = $TenLoaiSanPhamCap3;
    $loaisanphamcap3->MaLoaiSanPhamCap2 = $MaLoaiSanPhamCap2;
    $isset = $loaisanphamcap3->issetType();
    
    if($isset[0]['SoDong'] > 0)
        $Loi = true;
    
    if($Loi == false)
    {
        if($loaisanphamcap3->add())
            echo "yes";
        else
            echo "no";
    }
    else
    {
        echo "no";
    }
?>